#ifndef MOVE_H
#define	MOVE_H

#include <iostream>
#include <stdint.h>

#include "Common.h"
#include "Ant.h"

class Move
{
private:
    Ant ant;
    char move;
    Coord dest;
public:
    Move(const Ant & a, const Coord & d, char m) : ant(a), move(m)
    {        
        this->dest.row = d.row;
        this->dest.column = d.column;
    }
    
    Move(const Move & mo) : ant(mo.getAnt())
    {
        this->move = mo.move;
        this->dest.row = mo.dest.row;
        this->dest.column = mo.dest.column;
    }
    
    const Ant & getAnt() const
    {
        return this->ant;
    }
    
    char getMove() const
    {
        return this->move;
    }
    
    const Coord & getDest() const
    {
        return this->dest;
    }
    
    bool operator < (const Move & m) const
    {
        return (this->dest.row < m.dest.row) ||
                ((this->dest.row == m.dest.row) && (this->dest.column < m.dest.column));
    }
    
    bool operator == (const Move & m) const
    {
        return (this->dest.row == m.dest.row) && (this->dest.column == m.dest.column);
    }
    
};

ostream & operator << (ostream & os, const Move & m)
{
    os << "o " << m.getAnt().row() << ' ' << m.getAnt().column() << ' ' << m.getMove();
    return os;
}

#endif	/* MOVE_H */

